﻿@using CuongHanh.Context
@using CuongHanh.Models
@using CuongHanh.Models.View
@{
    Layout = "~/Views/Shared/_WoodLayout.cshtml";
    string sXemThem = Html.GetResource("xemthem");
}

@foreach (SubCategoryView item in Model)
{
    string subCategoryUrl = UrlManager.LinkWoodSubCategory(item.Id,
            item.Name,
            item.CategoryName);
    <div class="product-wrap">
        <div class="title-product">
            <h2>
                <a href="@subCategoryUrl">@item.Name</a>
            </h2>
            <a href="@subCategoryUrl" class="next-view">@sXemThem</a>
        </div>
        <div class="product-content">
            @foreach (ProductView product in item.ProductView)
            {
                string productUrl = UrlManager.LinkWoodProductDetail(product.Id,
                        product.Name.ToUrlName());

                <div class="product-box">
                    <div class="img-product">
                        <a href="@productUrl">
                            <img alt="" src="@Url.GetImage(product.Image,
                                                     ImageType.Small)"/>
                        </a>
                    </div>
                    <h4 class="price">
                        @product.Price.FormatNumber() <span>VNĐ</span></h4>
                    <h3 class="name-product">
                        <a href="@productUrl">@product.Name</a></h3>
                </div>
            }     
        </div>
    </div>
}